<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<rich:panel header="#{messages['prospect.list']}">
	
	<t:panelGrid columns="2" columnClasses="standardTable_ColumnLeft_20,standardTable_ColumnLeft_80" width="100%">
		<h:outputLabel for="cname" value="#{messages['registration.no']}" styleClass="standardText_Label" />
		<t:inputText id="cname"  size="30" maxlength="50" styleClass="standardText" value="#{agentProspectMagmtBean.regno}"></t:inputText>
		
		<t:outputText></t:outputText>
		<h:commandButton value="#{messages['search']}" styleClass="button"  immediate="true" action="#{agentProspectMagmtBean.searchAction}"></h:commandButton>
	</t:panelGrid>
	
	<rich:spacer height="20" />
	
	<rich:dataTable id="data" var="member" value="#{agentProspectMagmtBean.memberList}" rows="10" width="99%" rowKeyVar="rowNo">
		<%--<rich:column style="text-align:center;width:5%;" >
			<f:facet name="header">
				<h:selectBooleanCheckbox id="chkAll" onclick="checkAll(this.form,this)" ></h:selectBooleanCheckbox>
			</f:facet>
			<h:selectBooleanCheckbox id="chk" value=""></h:selectBooleanCheckbox>
		</rich:column>--%>
		<rich:column style="text-align:center;width:20%;">
			<f:facet name="header">
				<h:outputText value="#{messages['registration.no']}"></h:outputText>
			</f:facet>
			<h:commandLink value="#{member.memberRegNo}" action="#{agentProspectMagmtBean.editProspectAction}" immediate="true" actionListener="#{agentProspectMagmtBean.editProspectActionListener}"></h:commandLink>
			<f:param id="cmemberId" value="#{member.memberId}"/>
		</rich:column>
		<%--<rich:column style="text-align:center;width:15%;">
			<f:facet name="header">
				<h:outputText value="#{messages['ic.no']}"></h:outputText>
			</f:facet>
			<t:outputText styleClass="standardText" value="#{obj.label}"></t:outputText>
		</rich:column>--%>
		<rich:column style="text-align:center;width:15%;">
			<f:facet name="header">
				<h:outputText value="#{messages['cool.off.period.expiry.date']}"></h:outputText>
			</f:facet>
			<t:outputText styleClass="standardText" value="#{member.agreement.endCoolingPeriod} "></t:outputText>
		</rich:column>
		<rich:column style="text-align:center;width:10%;">
			<f:facet name="header">
				<h:outputText value="#{messages['status']}"></h:outputText>
			</f:facet>
			<t:outputText styleClass="standardText" value="#{member.statusLabel}"></t:outputText>
		</rich:column>
		<%--<rich:column style="text-align:center;width:13%;">
			<f:facet name="header">
				<h:outputText value="#{messages['assign.agreement']}"></h:outputText>
			</f:facet>
			<h:commandButton styleClass="button" value="#{messages['action']}" rendered="#{rowNo==0 || rowNo==1}" action="adminAssignCompAgreement" immediate="true"></h:commandButton>
			<h:outputText styleClass="standardText" rendered="#{rowNo!=0&&rowNo!=1}" value="Done"></h:outputText>
		</rich:column>--%>
		<rich:column style="text-align:center;width:13%;">
			<f:facet name="header">
				<h:outputText value="#{messages['document.check.list']}"></h:outputText>
			</f:facet>
			<h:commandButton styleClass="button" value="#{messages['action']}" rendered="#{member.status == agentProspectMagmtBean.agreeAckStatus || member.status ==agentProspectMagmtBean.checkListPedingStatus}" 
			action="#{agentProspectMagmtBean.checkListAction}" actionListener="#{agentProspectMagmtBean.checkListActionListener}" immediate="true"></h:commandButton>
			<h:outputText styleClass="standardText" rendered="#{member.status == agentProspectMagmtBean.pendingMemberStatus}" value="Done"></h:outputText>
			<h:outputText styleClass="standardText" rendered="#{member.status != agentProspectMagmtBean.agreeAckStatus 
			&& member.status !=agentProspectMagmtBean.checkListPedingStatus
			&& member.status != agentProspectMagmtBean.pendingMemberStatus
			}" value="N/A"></h:outputText>
			<f:param id="vmemberId" value="#{member.memberId}"/>
		</rich:column>
		
		<rich:column style="text-align:center;width:13%;">
			<f:facet name="header">
				<h:outputText value="#{messages['convert.to.member']}"></h:outputText>
			</f:facet>
			<h:commandButton styleClass="button" value="#{messages['action']}" 
			action="#{agentProspectMagmtBean.convertAction}" actionListener="#{agentProspectMagmtBean.convertActionListener}"
			rendered="#{member.status == agentProspectMagmtBean.pendingMemberStatus}" immediate="true"></h:commandButton>
			<h:outputText styleClass="standardText" rendered="#{member.status != agentProspectMagmtBean.pendingMemberStatus}" value="N/A"></h:outputText>
			<f:param id="amemberId" value="#{member.memberId}"/>
		</rich:column>
		
	</rich:dataTable>
	
	<rich:spacer height="30" />
	
	<rich:datascroller align="left"  for="data" maxPages="20" />

	<rich:spacer height="30" />
	
	<t:panelGrid columns="1" width="100%">
		<t:panelGroup>
		 	<h:commandButton value="#{messages['create.company.prospect']}" styleClass="button"  immediate="true" action="#{agentSelectMembershipBean.navCompSelectAction}"></h:commandButton>
		 	<f:verbatim>&nbsp;</f:verbatim>
		 	<h:commandButton value="#{messages['create.individual.prospect']}" styleClass="button"  immediate="true" action="#{agentSelectMembershipBean.navIndSelectAction}"></h:commandButton>
		 	<f:verbatim>&nbsp;</f:verbatim>
   			<h:commandButton value="#{messages['cancel']}" styleClass="button" immediate="true" action="#{agentProspectMagmtBean.backAction}"></h:commandButton>
   		</t:panelGroup>
	</t:panelGrid>
</rich:panel>
